package StudyCode.summary.mydatetime;

import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneId;
import java.time.ZonedDateTime;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class TimeZoneToAnotherTimeZone {
	public static void main(String[] args) {
		LocalDateTime ldt = LocalDateTime.of(2019, Month.MAY, 14, 16, 30);
		System.out.println(ZoneId.systemDefault() + "时区:" + ldt);

		ZoneId usCentral = ZoneId.of("America/Chicago");
		ZonedDateTime zdt = ZonedDateTime.of(ldt, usCentral);
		System.out.println(usCentral + "时区:" + zdt);

		ZoneId asiaKolkata = ZoneId.of("Asia/Kolkata");
		ZonedDateTime zdt2 = zdt.withZoneSameInstant(asiaKolkata);
		System.out.println(asiaKolkata + "时区:" + zdt2);

	}
}
